<?php

class Ialbum_Widget_PeopleInAlbumController extends Engine_Content_Widget_Abstract
{
  public function indexAction()
  {
	if (!Engine_Api::_()->core()->hasSubject()) {
      return $this->setNoRender();
    }
    $subject = Engine_Api::_()->core()->getSubject();
    if(!($subject instanceof Album_Model_Album)) return $this->setNoRender();  
    
    $this->view->people = $people = Engine_Api::_()->ialbum()->getPeopleInAlbum($subject->getIdentity());
    $count = count($people);
    if ($count <= 0) {
      return $this->setNoRender();
    }
  }
}
